<template>
	<view class="content">
		<view class="class" v-for="(item,index) in list">
			<view class="classlist" @click="xl(item)">
				<text>{{item.title}}</text>
				<image src="../../../static/school/zs1.png" mode=""></image>
			</view>

			<view class="zs" v-show="item.state">
				<view class="zslist" v-for="(itemen,index) in item.classlist">
					<view class="zs_left">
						{{itemen.title}}
					</view>
					<view class="zs_right">
						<view class="zs_bt1">
							<button type="default">修改</button>
						</view>
						<view class="zs_bt2">
							<button type="default">删除</button>
						</view>
					</view>
				</view>

				<view class="zs_bt">
					<button type="default">添加班级</button>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: [{
						id: 0,
						title: 'A年级名称',
						state: false,
						classlist: [{
								id: 0,
								title: 'A班级名称'
							},
							{
								id: 0,
								title: 'A班级名称'
							},
						]
					},
					{
						id: 0,
						title: 'A年级名称',
						state: false,
						classlist: [{
								id: 0,
								title: 'A班级名称'
							},
							{
								id: 0,
								title: 'A班级名称'
							},
						]
					}
				]
			}
		},
		methods: {
			xl(item) {
				item.state=!item.state
			}
		}
	}
</script>

<style>
	.content {
		width: 750rpx;
		height: 1624rpx;
		background: #FAFAFA;
		border-radius: 0rpx 0rpx 0rpx 0rpx;
		padding-top: 40rpx;
	}

	.classlist {
		display: flex;
		width: 690rpx;
		height: 116rpx;
		background: #FFFFFF;
		border-radius: 8rpx 8rpx 8rpx 8rpx;
		align-items: center;
		margin: 40rpx auto 0;
		font-family: PingFang SC, PingFang SC;
		font-weight: bold;
		font-size: 32rpx;
		color: #333333;
	}

	.classlist text {
		margin-left: 32rpx;
	}

	.classlist image {
		width: 70rpx;
		height: 40rpx;
		margin-left: auto;
		margin-right: 32rpx;

	}

	.zs {
		width: 690rpx;
		height: 336rpx;
		background: #FFFFFF;
		border-radius: 0 0 8rpx 8rpx;
		margin: auto;
	}

	.zslist {
		width: 626rpx;
		height: 88rpx;
		background: #ECF0FF;
		border-radius: 4rpx 4rpx 4rpx 4rpx;
		margin: 0 auto 16rpx;
		display: flex;
		align-items: center;
	}

	.zs_left {
		margin-left: 26rpx;
	}

	.zs_bt1 {
		margin-right: 32rpx;
	}

	.zs_bt1 button {
		width: 120rpx;
		height: 56rpx;
		background: #1D8CFF;
		border-radius: 4rpx 4rpx 4rpx 4rpx;
		font-family: PingFang SC, PingFang SC;
		font-weight: bold;
		font-size: 28rpx;
		color: #FFFFFF;
		display: flex;
		justify-content: center;
		align-items: center;
	}

	.zs_right {
		display: flex;
		margin-left: auto;

	}

	.zs_bt2 button {
		width: 120rpx;
		height: 56rpx;
		background: #4461D9;
		border-radius: 4rpx 4rpx 4rpx 4rpx;
		font-family: PingFang SC, PingFang SC;
		font-weight: bold;
		font-size: 28rpx;
		color: #FFFFFF;
		display: flex;
		justify-content: center;
		align-items: center;
		margin-right: 16rpx;
	}

	.zs_bt button {
		width: 560rpx;
		height: 96rpx;
		background: #FFFFFF;
		border-radius: 4rpx 4rpx 4rpx 4rpx;
		border: 4rpx solid #1D8CFF;
		margin-top: 32rpx;
		font-family: PingFang SC, PingFang SC;
		font-weight: bold;
		font-size: 32rpx;
		color: #1D8CFF;
		display: flex;
		align-items: center;
		justify-content: center;
	}
</style>